// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.worldMap.styles;

import java.util.ArrayList;
import zombie.core.textures.Texture;
import zombie.worldMap.WorldMapFeature;

public class WorldMapPolygonStyleLayer extends WorldMapStyleLayer {
    public final ArrayList<WorldMapStyleLayer.ColorStop> m_fill = new ArrayList();
    public final ArrayList<WorldMapStyleLayer.TextureStop> m_texture = new ArrayList();
    public final ArrayList<WorldMapStyleLayer.FloatStop> m_scale = new ArrayList();

    public WorldMapPolygonStyleLayer(String id) {
        super(id);
    }

    @Override
    public String getTypeString() {
        return "Polygon";
    }

    @Override
    public void render(WorldMapFeature feature, WorldMapStyleLayer.RenderArgs args) {
        WorldMapStyleLayer.RGBAf rGBAf = this.evalColor(args, this.m_fill);
        if (rGBAf.a < 0.01F) {
            WorldMapStyleLayer.RGBAf.s_pool.release(rGBAf);
        } else {
            float _float = this.evalFloat(args, this.m_scale);
            Texture texture = this.evalTexture(args, this.m_texture);
            if (texture != null && texture.isReady()) {
                args.drawer.fillPolygon(args, feature, rGBAf, texture, _float);
            } else {
                args.drawer.fillPolygon(args, feature, rGBAf);
            }

            WorldMapStyleLayer.RGBAf.s_pool.release(rGBAf);
        }
    }
}
